package com.pwt.repository;

import com.pwt.model.ComboBoxModel;
import com.pwt.repository.base.BaseRepository;
import com.pwt.entity.MASCHINE;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * MASCHINE Repository层
 *
 * @author auto generated
 * @date 2021-09-18 14:59:40
 */
public interface MASCHINERepository extends BaseRepository<MASCHINE, Integer> ,MASCHINERepositoryExtension{

    @Query(nativeQuery = true,value = "select * from MASCHINE where MAMASCHINE = ?1")
    public  MASCHINE getBymAMASCHINE(Integer mamaschine);


    @Query(nativeQuery = true,value = "SELECT * from MASCHINE m\n" +
            "left join hierarchy h on m.MAMASCHINE=h.number\n" +
            "where h.number is null")
    List<MASCHINE> queryMaschine();
}
